.category {
  height: 100vh;
  background-color: #fff;

  .category-search-box {
    background-color: #f2f7f5;
    display: flex;
    align-items: center;
    padding: 15rpx 25rpx;
    width: 700rpx;
    margin: 0 auto;
    font-size: 28rpx;
    border-radius: 30rpx;
    height: 60rpx;
    box-sizing: border-box;

    .category-search-box-text {
      margin-left: 15rpx;
      color: #97979a;
    }
  }

  .category-tab {
    height: 80rpx;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;

    .display-method {
      position: absolute;
      width: 77rpx;
      height: 100%;
      right: 0;
      border-left: 3rpx solid #f6f6f6;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .category-tab-item-active {
      color: #1989fa;
    }
  }
}

.product-category-container {
  height: calc(100vh - 161rpx);
  display: flex;

  .product-category-container-aside {
    width: 200rpx;
    height: calc(100vh - 161rpx);
    background-color: #f2f7f5;

    .product-category-container-aside-scroll-view {
      height: calc(100vh - 161rpx);

      .product-category-container-aside-scroll-view-item {
        font-size: 28rpx;
        height: 100rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
        padding: 0 30rpx;
      }

      .product-category-container-aside-scroll-view-item-active {
        position: relative;
        background-color: #fff;

        &::before {
          content: ' ';
          width: 8rpx;
          height: 50rpx;
          background-color: #1989fa;
          position: absolute;
          left: 0;
          top: 50%;
          transform: translateY(-50%);
        }
      }
    }
  }

  .product-category-container-content {
    width: 550rpx;
    height: calc(100vh - 161rpx);
    background-color: #fff;

    .category-select-region {
      height: 145rpx;
      display: flex;

      .category-select-region-sub-category-list {
        width: 550rpx;
        box-sizing: border-box;
        padding-top: 13rpx;
        padding-left: 18rpx;

        .secondary-category-list {
          width: 510rpx;

          .secondary-category-list-content {
            display: flex;
            gap: 16rpx;

            .secondary-category-list-content-item {
              white-space: nowrap;
              padding: 10rpx 20rpx;
              background-color: #f5f5f5;
              color: #656565;
              border-radius: 25rpx;
            }

            .secondary-category-list-content-item-active {
              background-color: #e0eefc;
              color: #1989fa;
            }
          }
        }

        .tertiary-category-list {
          width: 510rpx;
          margin-top: 15rpx;

          .tertiary-category-list-content {
            display: flex;
            gap: 30rpx;
            box-sizing: border-box;
            padding: 0 5px;

            .tertiary-category-list-content-item {
              white-space: nowrap;
              color: #9c9c9c;
              border-radius: 25rpx;
            }

            .tertiary-category-list-content-item-active {
              color: #2c2c2c;
              font-weight: bold;
            }
          }
        }
      }
    }

    .category-product-list-order-by {
      display: flex;
      width: 100%;
      box-sizing: border-box;
      padding-right: 20rpx;
      font-size: 25rpx;
      color: #686868;

      .category-product-list-order-by-sale-count {
        margin-left: auto;
        margin-right: 40rpx;
      }

      .category-product-list-order-by-price {
        display: flex;
        align-items: center;

        .category-product-list-order-by-price-text {
          margin-right: 10rpx;
        }

        .category-product-list-order-by-price-text-active {
          color: #1989fa;
        }

        .category-product-list-order-by-price-icons {
          display: flex;
          flex-direction: column;
          justify-content: center;

          .icon-up-active {
            border-bottom: 12rpx solid #1989fa !important;
          }

          .icon-down-active {
            border-top: 12rpx solid #1989fa !important;
          }

          .icon-up {
            width: 0;
            height: 0;
            border-left: 12rpx solid transparent;
            border-right: 12rpx solid transparent;
            border-bottom: 12rpx solid #dedede;
            /* 灰色下边框形成上三角 */
            margin-bottom: 4rpx;
          }

          .icon-down {
            width: 0;
            height: 0;
            border-left: 12rpx solid transparent;
            border-right: 12rpx solid transparent;
            border-top: 12rpx solid #dedede;
            /* 红色上边框形成下三角 */
          }
        }
      }

      .category-product-list-order-by-active {
        color: #1989fa;
      }
    }

    .product-list {
      width: 100%;
      box-sizing: border-box;
      padding-top: 20rpx;
      padding-left: 20rpx;
      padding-right: 20rpx;
      padding-bottom: 10rpx;

      .product-card {
        height: 170rpx;
        display: flex;
        margin-bottom: 35rpx;

        .product-card-image {}

        .product-card-image-no-stock {
          position: relative;
          width: 170rpx;
          /* 与图片宽高保持一致 */
          height: 170rpx;

          /* 遮罩层：绝对定位，覆盖整个图片区域 */
          .stock-mask {
            position: absolute;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.4);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);

            .stock-mask-container {
              color: #fff;
              font-size: 28rpx;
              border: 2rpx dashed #fff;
              box-sizing: border-box;
              padding: 35rpx;
              border-radius: 999rpx;
            }

            border-radius: 999rpx;
          }

          /* 遮罩文字：块级显示，保证居中对齐 */
          .mask-text {
            display: block;
            text-align: center;
          }
        }

        .product-card-info {
          margin-left: 20rpx;
          height: 170rpx;
          display: flex;
          flex-direction: column;

          .product-card-name {
            font-size: 28rpx;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
          }

          .product-card-tags {
            display: flex;
            margin-top: 15rpx;

            .product-card-tag {
              color: #a0a0a0;
              font-size: 20rpx;
              border: 3rpx solid #d9d9d6;
              padding: 3rpx 5rpx;
              border-radius: 10rpx;
            }
          }

          .product-card-price {
            display: flex;
            margin-top: auto;
            align-items: baseline;
            color: red;

            .product-card-price-symbol {
              font-size: 20rpx;
            }

            .product-card-price-value {
              font-size: 30rpx;
            }
          }
        }
      }
    }
  }

  .product-category-container-content-scroll-view {
    width: 550rpx;
    height: calc(100vh - 161rpx);
    background-color: #fff;
    box-sizing: border-box;
    padding-left: 20rpx;
    padding-bottom: 10rpx;

    .product-category-container-content-scroll-view-content-secondary-item {
      margin-top: 25rpx;

      .product-category-container-content-scroll-view-content-secondary-item-name {}

      .product-category-container-content-scroll-view-content-secondary-item-sub-content {
        margin-top: 25rpx;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        row-gap: 20rpx;

        .product-category-container-content-scroll-view-content-secondary-item-sub-content-item {
          display: flex;
          flex-direction: column;
          align-items: center;

          .product-category-container-content-scroll-view-content-secondary-item-sub-content-item-image {}

          .product-category-container-content-scroll-view-content-secondary-item-sub-content-item-name {
            font-size: 25rpx;
            margin-top: 15rpx;
            width: 150rpx;
            text-align: center;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }
      }
    }
  }
}
.brand-category-container{
  background-color: #1989fa;
}

.product-brand-container{
  background-color: #f1f1f1;
  .brand-card-container{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    row-gap: 25rpx;
    box-sizing: border-box;
    padding-right: 25rpx;
    .brand-card-item{
      display: flex;
      flex-direction: column;
      align-items: center;
      .brand-card-item-image{
          width: 160rpx;
          height: 160rpx;
          border-radius: 20rpx;
          overflow: hidden;
      }
      .brand-card-item-name{
        font-size: 25rpx;
        white-space: nowrap;
        margin-top: 15rpx;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 160rpx;
        text-align: center;
      }
    }
  }
}